<template>
  <main>
    <h1>用户安全</h1>
    <div v-show="showLostPassword||showF">
      <button @click="returnIndex">返回</button>
      <lost-password v-if="showLostPassword"/>
      <frozen v-if="showF"/>
    </div>
    <div v-show="!showLostPassword">
      <button @click="showLostPassword=!showLostPassword">重置您的密码</button>
      <br>
      <button @click="showF=!showF">解冻或冻结您的账户</button>
      <br>
      <p>如果您需要对您的账户进行更多操作请联系管理员</p>
    </div>
    <div class="bottom-buttons">
      <button @click="jump('src/page/home/index.html')" class="backHomeBtn">返回首页</button>
      <button @click="jump('src/page/login/index.html')" class="backHomeBtn">返回登录页面</button>
    </div>
  </main>
  <Bottom/>
</template>
<script setup lang="ts">
import Bottom from "@components/bottom.vue";
import LostPassword from "@components/lost-password.vue";
import {ref} from "vue";
import Frozen from "@components/frozen.vue";
import {jump} from "@utils/router.js";

const showLostPassword = ref(false);
const showF = ref(false)

function returnIndex() {
  showLostPassword.value = false
  showF.value = false
}
</script>
<style scoped>
/* 主安全页面样式 */
main {
  display: flex;
  flex-direction: column;
  gap: 2rem;
  min-height: 70vh;
  position: relative;
  background: rgba(26, 26, 26, 0.5);
  backdrop-filter: blur(1px);
}

h1 {
  text-align: center;
  font-size: 2.5em;
  margin-bottom: 1rem;
  background: linear-gradient(135deg, var(--primary-red), var(--primary-purple));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  text-shadow: 0 4px 15px rgba(255, 42, 109, 0.3);
}

/* 操作按钮容器 */
div[v-show="!showLostPassword"] {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
  align-items: center;
  text-align: center;
  padding: 2rem;
  background: rgba(42, 42, 42, 0.6);
  backdrop-filter: blur(10px);
  border-radius: 16px;
  border: 1px solid rgba(255, 42, 109, 0.2);
  box-shadow: var(--shadow-secondary);
}

/* 主要操作按钮 */
button {
  padding: 1em 2em;
  border-radius: 12px;
  border: 2px solid transparent;
  background: linear-gradient(135deg, var(--primary-red), var(--primary-purple));
  color: var(--text-primary);
  font-size: 1.1em;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s ease;
  position: relative;
  overflow: hidden;
  box-shadow: var(--shadow-primary);
  min-width: 250px;
}

button::before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
  transition: left 0.5s ease;
}

button:hover::before {
  left: 100%;
}

button:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-glow);
  border-color: var(--primary-red-light);
}

/* 返回按钮特殊样式 */
button[onclick="returnIndex"] {
  align-self: flex-start;
  background: var(--secondary-gray);
  border-color: var(--secondary-gray-light);
  font-size: 1em;
  padding: 0.8em 1.6em;
  min-width: auto;
}

button[onclick="returnIndex"]:hover {
  background: var(--secondary-gray-light);
  border-color: var(--accent-blue);
  box-shadow: 0 0 15px rgba(77, 195, 255, 0.4);
}

/* 提示文字 */
p {
  color: var(--text-secondary);
  font-size: 1em;
  line-height: 1.6;
  max-width: 500px;
  margin: 1rem 0;
}

/* 底部按钮容器 */
.bottom-buttons {
  margin-top: 2rem;
  width: 100%;
  display: flex;
  justify-content: center;
}

.backHomeBtn {
  background: linear-gradient(135deg, var(--accent-blue), var(--accent-blue-light));
  box-shadow: 0 4px 15px rgba(0, 168, 255, 0.3);
}

.backHomeBtn:hover {
  border-color: var(--accent-blue-light);
  box-shadow: 0 6px 20px rgba(0, 168, 255, 0.5);
}

/* 响应式设计 */
@media (max-width: 768px) {
  h1 {
    font-size: 2em;
  }

  div[v-show="!showLostPassword"] {
    padding: 1.5rem;
  }

  button {
    min-width: 200px;
    padding: 0.8em 1.5em;
    font-size: 1em;
  }
}

@media (max-width: 480px) {
  h1 {
    font-size: 1.8em;
  }

  div[v-show="!showLostPassword"] {
    padding: 1rem;
  }

  button {
    min-width: 180px;
    padding: 0.7em 1.2em;
    font-size: 0.95em;
  }

  p {
    font-size: 0.9em;
  }
}
</style>
